/**
 * 给一个数组，要求构造一个排列P，每一个位置必须满足
 * Ai == -1 or Ai == Pi
 * 因为N只有10，枚举所有排列即可
 */
#include <bits/stdc++.h>
using namespace std;

using llt = long long;
using vi = vector<int>;


int N;
vi A;

bool isok(const vi & v){
    for(int i=0;i<N;++i){
        if(-1 == A[i]) continue;
        if(A[i] == v[i]) continue;
        return false;
    }
    return true;
}

void work(){
    cin >> N;
    A.assign(N, {});
    for(auto & i : A) cin >> i;

    vector<int> v(N, 0);
    for(int i=1;i<=N;++i) v[i - 1] = i;

    do{
        if(isok(v)){
            cout << "Yes" << endl;
            for(auto i : v) cout << i << " ";
            cout << endl;
            return;
        }
    }while(next_permutation(v.begin(), v.end()));

    cout << "No" << endl;
    return;
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);	
    int nofkase = 1;
    while(nofkase--) work();
	return 0;
}